#ifndef __STDAFX_H__
#define __STDAFX_H__
#include "Common.h"
#ifdef _WIN32

#define CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES

#define WIN32_LEAN_AND_MEAN

#include <tchar.h>
#include <windows.h>
#include <winsock2.h>
#include <io.h>
#include <direct.h>

#pragma warning(disable : 4100 4189 4390)

#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "lua51.lib")
#else

#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <asm/ioctls.h>

#include <pthread.h>
#include <semaphore.h>

#include <sys/io.h>
#include <errno.h>
//#include <atomic>
#endif

extern "C" 
{     
#include "lua.h"     
#include "lualib.h"     
#include "lauxlib.h" 
} 
#include <time.h>
#include <sys/stat.h>
#include <string.h>
#include <typeinfo>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <memory>
#include <boost/functional.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>

namespace std
{
	using namespace boost;
}

#ifndef _WIN32

namespace std
{
	using namespace __gnu_cxx;
}

#endif

//#include <cppconn/driver.h>
//#include <cppconn/exception.h>
//#include <cppconn/resultset.h>
//#include <cppconn/statement.h>
//#include <cppconn/prepared_statement.h>
//#include <cppconn/connection.h>

#ifndef _WIN32

namespace std
{
	using namespace __gnu_cxx;
}

typedef Int64 __int64;
typedef Int32 SOCKET;

#define _CrtCheckMemory(x)		(1)

#define strcpy_s				strcpy
#define sprintf_s 				sprintf
#define sscanf_s				sscanf
//#define auto_ptr				unique_ptr

#define _ASSERT(x)				assert(x)
#define MAX_PATH				512
#define SOCKET_ERROR			-1
#define INVALID_SOCKET			-1
#include <stdio.h>   
#include <stdarg.h>
#endif

#include <time.h>
#include <sys/stat.h>
#include <string.h>
#include <typeinfo>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <memory>
#include <boost/functional.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>

#include "Network.h"
#include "Config.h"
#include "CSVReader.h"
#include "DataBlock.h"
#include "PacketDecoder.h"
#include "PacketEncoder.h"
#include "PacketDispatcher.h"
#include "TimerHandler.h"
#include "TimerManager.h"
#include "Common.h"
#include "Const.h"
#include "CharInfo.h"
#include "Script.h"
#include "ScriptManager.h"
#include "Item.h"
#include "ItemManager.h"
#include "TaskManager.h"
#include "Skill.h"
#include "SkillManager.h"
#include "MallManager.h"
#include "TitleManager.h"
#include "BuffManager.h"
#include "CopyManager.h"
#include "Faction.h"
#include "FactionManager.h"
#include "RankManager.h"
#include "Pet.h"
#include "PetManager.h"
#include "Lover.h"
#include "LoverManager.h"
#include "NPC.h"
#include "NPCManager.h"
#include "Slave.h"
#include "SlaveManager.h"
#include "Map.h"
#include "MapManager.h"
#include "Home.h"
#include "HomeManager.h"
#include "PlayerBase.h"
#include "PlayerItem.h"
#include "PlayerSkill.h"
#include "PlayerPet.h"
#include "PlayerTeam.h"
#include "PlayerFriend.h"
#include "PlayerTask.h"
#include "PlayerLover.h"
#include "PlayerHome.h"
#include "PlayerSlave.h"
#include "PlayerTitle.h"
#include "PlayerBuff.h"
#include "PlayerFaction.h"
#include "PlayerStall.h"
#include "Player.h"
#include "PlayerManager.h"
#include "Battle.h"
#include "BattleManager.h"
#include "Team.h"
#include "TeamManager.h"
#include "GameServer.h"
#include "ClientCallbackData.h"
#include "ServerCallbackGame.h"
#include "Logger.h"
#include "Gate.h"
#include "GateManager.h"
#include "ModulePlayer.h"
#include "ModuleMap.h"
#include "ModuleItem.h"
#include "ModuleBattle.h"
#include "ModuleFaction.h"
#include "ModuleHome.h"
#include "LuaBattle.h"
#include "LuaPlayer.h"
#ifdef _DEBUG
#pragma comment(lib, "Common_d.lib")
#else
#pragma comment(lib, "Common.lib")
#endif

#endif